﻿using System.Collections.Generic;

namespace MangaGrr.DomainModel
{
    public class MangaSite
    {
        public MangaSite()
        {
            //set default values
            MatureParam = string.Empty;
            MangaNextPagePattern = string.Empty;
            MangaLastPageNumberPattern = string.Empty;
            MangaPageFormat = string.Empty;
            ChapterNextPagePattern = string.Empty;
            ChapterStartReadingPattern = string.Empty;
        }

        private Dictionary<string, Manga> _mangaCollection = new Dictionary<string, Manga>();

        public string Name { get; set; }
        public string MangaListURL { get; set; }

        /// <summary>
        /// Regex pattern for getting list of mangas of a MangaSite from MangaList page (specified in MangaListURL)
        /// </summary>
        public string MangaPattern { get; set; }

        /// <summary>
        /// Parameter to access manga that has mature content. If not necessary set this to be String.Empty
        /// </summary>
        public string MatureParam { get; set; }

        /// <summary>
        /// Regex pattern for getting Name of a Manga from Manga info string (retrieved using MangaPattern)
        /// </summary>
        public string MangaNamePattern { get; set; }

        /// <summary>
        /// Regex pattern for getting URL to next page of manga list. Only needed if data paging is implemented.
        /// </summary>
        public string MangaNextPagePattern { get; set; }

        /// <summary>
        /// Regex pattern for retrieving the last page number of manga list. Only needed if data paging is implemented.
        /// </summary>
        public string MangaLastPageNumberPattern { get; set; }

        /// <summary>
        /// String format of manga list's pages' url (e.g http://www.mangafox.com/directory/{0}.htm. Only needed if data paging is implemented and can be only used if last page number can be retrieved.
        /// </summary>
        public string MangaPageFormat { get; set; }

        /// <summary>
        /// Regex pattern for getting list of Chapters of a Manga from Manga page (specified in Manga.URL)
        /// </summary>
        public string ChapterPattern { get; set; }

        /// <summary>
        /// Regex pattern for getting extra information such as Volume and Number of a Chapter from Chapter info string (retrieved using ChapterPattern)
        /// </summary>
        public string ChapterOrderPattern { get; set; }

        /// <summary>
        /// Regex pattern for getting Name of a Chapter from Chapter info string (retrieved using ChapterPattern)
        /// </summary>
        public string ChapterNamePattern { get; set; }

        /// <summary>
        /// Regex pattern for getting URL to next page of chapter list. Only needed if data paging is implemented, is empty by default.
        /// </summary>
        public string ChapterNextPagePattern { get; set; }

        /// <summary>
        /// Regex pattern for getting "Start Reading" URL of a Chapter. Only necessary if users must click on a "Start reading" link to read. Is empty by default.
        /// </summary>
        public string ChapterStartReadingPattern { get; set; }

        /// <summary>
        /// Regex pattern for getting total of Pages in a Chapter from Chapter/Page page (specified in Chapter.URL/Page.URL)
        /// </summary>
        public string ChapterTotalPagePattern { get; set; }

        /// <summary>
        /// Regex pattern for getting image URL of a Page from Chapter/Page page (specified in Chapter.URL/Page.URL)
        /// </summary>
        public string PageImagePattern { get; set; }

        /// <summary>
        /// Regex pattern for getting next Page URL of the current Page from Chapter/Page page (specified in Chapter.URL/Page.URL)
        /// </summary>
        public string PageNextPagePattern { get; set; }
    }
}
